import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 98152
 * Date: 2024-10-30
 * Time: 18:54
 */
public class Test1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        StringBuffer str = new StringBuffer();
        int n = N;
        int count = 0;
        while(n != 0) {
            int tmp = n % 10;
            str.append(tmp);
            n /= 10;
            count++;
            if(n != 0 && count % 3 == 0) {
                str.append(",");
            }
        }
        String result = str.reverse().toString();
        System.out.println(result);
    }
}
